home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 1287 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.1 KB  |  36 lines

  1. Newsgroups: comp.lang.c
  2. Path: news3.noc.netcom.net!zdc!zippo!usenet
  3. From: Jim McFarland <jgm6@orkand.em.cdc.gov>
  4. Subject: Re: Executing DOS command from C
  5. Content-Type: text/plain; charset=us-ascii
  6. Sender: usenet@news.zippo.com
  7. Content-Transfer-Encoding: 7bit
  8. Nntp-Posting-Host: 158.111.166.77
  9. Organization: The Orkand Corporation
  10. Message-ID: <DL2zMr.AA6@news.zippo.com>
  11. References: <4d28di$b7g@globe.indirect.com>
  12. X-Mailer: Mozilla 1.1N (Windows; I; 16bit)
  13. Mime-Version: 1.0
  14. Date: Fri, 12 Jan 1996 18:35:14 GMT
  15.  
  16. wayneft@indirect.com wrote:
  17. >I know that this is probably a stupid question, but it's been a while
  18. >since I have programmed in C.  My question is what is the command in a
  19. >C program that executes a DOS command such as DIR, or COPY.  I've
  20. >looked through all my books and for some reason I just can't seem to
  21. >find it.  I know it is a real simple command that is in the dos.h
  22. >header file.  If someone could email me or post the command I would be
  23. >very grateful, I need it because I have to something for work.
  24. >
  25. >wayneft@indirect.com
  26. >
  27. >
  28.  
  29. Try using the function system(), e.g.:
  30.  
  31.    system( "dir" );
  32.  
  33. Jim
  34.  
  35.  
  36.